<template>
  <!-- 部分请看App.vue -->
  <div class="person">
    <h1>中国</h1>
    <h2 ref="title2">北京</h2>
    <h3>蚊子</h3>
    <button @click="showLog">点我输出h2这个元素</button>
  </div>
</template>
<script setup lang="ts">
import { ref, defineExpose } from "vue";
//创建一个title2，用于存储ref标记的内容

let title2 = ref();
let a = ref();
let b = ref();
let c = ref();
function showLog() {
  console.log(title2.value);
}
defineExpose({ a, b, c });
</script>
